#define _CRT_SECURE_NO_WARNINGS
#include"list.h"
int main() {
	List* head = NULL;
	int n, i;
	cin >> n;
	int num = 0;
	for (i = 0; i < n; i++)
	{
		cin >> num;
		addlist(&head, num);
	}
	printlist(&head);
	int x = 0;
	cin >> x;
	List*newhead=cutlist(&head, x);
	printlist(&newhead);
	system("pause");
}